<HTML>
    <HEAD>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  <title>操作系统基础信息测试页面</title>
  <script type="text/javascript" src="./js/service.js"></script>
  <script type="text/javascript" src="./js/jquery-1.9.1.min.js"></script>
  <script src="./js/qwebchannel.js"></script>
      <TITLE>操作系统基础信息测试页面</TITLE>
      <SCRIPT language=JavaScript>
              var websocket_url = 'ws://localhost:12345';
              var websocket = null;

              if (websocket === null) {
                  websocket = new WebSocket(websocket_url);
                  websocket.onopen = function () {
                      console.log("connect websocketserver success");
                  }
              } else {
                  websocket.close();
                  websocket = null;
              }

              function getSystemArchitecture() {
                  console.log("getSystemArchitecture")
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemArchitecture();
                          }
                      );
              }
              function getSystemName() {
                  console.log("getSystemName")
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemName();
                          }
                      );
              }
              function getSystemVersion() {
                  console.log("getSystemVersion")
                  pid = $("#pid").val();
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemVersion(pid);
                          }
                      );
              }
              function getSystemActivationStatus() {
                  console.log("getSystemActivationStatus")
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemActivationStatus();
                          }
                      );
              }
              function getSystemSerialNumber() {
                  console.log("getSystemSerialNumber")
                  pid = $("#pid").val();
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemSerialNumber();
                          }
                      );
              }
              function getSystemKernelVersion() {
                  console.log("getSystemKernelVersion")
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemKernelVersion();
                          }
                      );
              }
              function getSystemEffectUser() {
                  console.log("getSystemEffectUser")
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemEffectUser();
                          }
                      );
              }
              function getSystemProjectName() {
                  console.log("getSystemProjectName")
                  pid = $("#pid").val();
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemProjectName();
                          }
                      );
              }

              function getSystemProjectSubName() {
                  console.log("getSystemProjectSubName")
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemProjectSubName();
                          }
                      );
              }
              function getSystemProductFeatures() {
                  console.log("getSystemProductFeatures")
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemProductFeatures();
                          }
                      );
              }
              function getSystemHostVirtType() {
                  console.log("getSystemHostVirtType")
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemHostVirtType();
                          }
                      );
              }
              function getSystemHostCloudPlatform() {
                  console.log("getSystemHostCloudPlatform")
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemHostCloudPlatform();
                          }
                      );
              }
              function getSystemOSVersion() {
                  console.log("getSystemOSVersion")
                  pid = $("#pid").val();
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemOSVersion();
                          }
                      );
              }
              function getSystemUpdateVersion() {
                  console.log("getSystemUpdateVersion")
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemUpdateVersion();
                          }
                      );
              }
              function getSystemIsZYJ() {
                  console.log("getSystemIsZYJ")
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSystemIsZYJ();
                          }
                      );
              }
              function getSysLegalResolution() {
                  console.log("getSysLegalResolution")
                  new QWebChannel(websocket,function(channel){
                          var sysinfo = channel.objects.sysinfo;
                          sysinfo.sendText.connect(function(message) {
                              console.log("Received message: " + message);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                              document.getElementById("res").value = message;
                          });
                          sysinfo.getSysLegalResolution();
                          }
                      );
              }
        //-->
      </SCRIPT>
      <META content="MSHTML 6.00.2900.6287" name=GENERATOR>
      <style>
        table tr td{padding: 5px;}
      </style>
  
    </HEAD>
    <BODY>
      <div style="margin:30 5 20 5">
        <div>
          <input onclick="getSystemArchitecture()" type="button" value="操作系统架构信息"  style="width: 120px; height: 50px">
          <input onclick="getSystemName()" type="button" value="操作系统名称"  style="width: 100px; height: 50px">
          <input onclick="getSystemVersion()" type="button" value="操作系统版本号"  style="width: 100px; height: 50px">
          <input onclick="getSystemActivationStatus()" type="button" value="操作系统激活状态"  style="width: 100px; height: 50px">
          <input onclick="getSystemSerialNumber()" type="button" value="操作系统服务序列号"  style="width: 100px; height: 50px">
         
          <input onclick="getSystemKernelVersion()" type="button" value="内核版本号"  style="width: 120px; height: 50px">
          <input onclick="getSystemEffectUser()" type="button" value="当前登录用户的用户名"  style="width: 100px; height: 50px">
          <input onclick="getSystemProjectName()" type="button" value="操作系统项目编号名"  style="width: 100px; height: 50px">
          <input onclick="getSystemProjectSubName()" type="button" value="操作系统项目子编号名"  style="width: 100px; height: 50px">
          <input onclick="getSystemProductFeatures()" type="button" value="操作系统产品标识码"  style="width: 100px; height: 50px">

          <input onclick="getSystemHostVirtType()" type="button" value="操作系统宿主机的虚拟机类型"  style="width: 120px; height: 50px">
          <input onclick="getSystemHostCloudPlatform()" type="button" value="操作系统宿主机的云平台类型"  style="width: 100px; height: 50px">
          <input onclick="getSystemOSVersion()" type="button" value="操作系统OS版本号"  style="width: 100px; height: 50px">
          <input onclick="getSystemUpdateVersion()" type="button" value="操作系统Update版本号"  style="width: 100px; height: 50px">
          <input onclick="getSystemIsZYJ()" type="button" value="镜像系统是否为专用机系统"  style="width: 100px; height: 50px">

          <input onclick="getSysLegalResolution()" type="button" value="屏幕设置的分辨率"  style="width: 100px; height: 50px">
        </div>
        <div id="input_box2">
            <h3>获取版本号:</h3>
            <label>
              <input type="text" id="pid" style="height: 30px; width: 200px;" placeholder="获取版本号">
            </label>
          </div>
        <div style="margin-top:20">
          <div align=left style="margin:5 0 5 0">回复：</div>
          <div>
          <textarea id="res" style="width:1000px;height:500px" ></textarea>
          </div>
        </div>
      </div>
    </BODY>
  </HTML>
  